import request from '@/utils/request.js'
const PATH = '/admin/banner'

// 获取轮播图列表
export function getBannerList({ page, pageSize, title, status }) {
  return request.get(PATH + '/page', {
    params: {
      page,
      pageSize,
      title,
      status
    }
  })
}

// 添加轮播图
export const insertBanner = (data) => request.post(PATH + '/insert', data)

// 批量删除轮播图
export const batchDeleteBanner = (ids) =>
  request.delete(PATH + '/batchDelete', {
    params: {
      ids: ids.join(',')
    }
  })

// 修改轮播图状态
export const updateBannerStatus = ({ id, status }) => {
  return request.put(PATH + `/status/${status}`, {
    id
  })
}
